﻿namespace PoliticalClassifier.Support
{
    /// <summary>
    /// Point2D represents a data point of voter data.
    /// </summary>
    public struct Point2D
    {
        #region Construction
        /// <summary>
        /// Constructor.  Sets the initial (X, Y) coordiate of the data point.
        /// </summary>
        /// <param name="x">The x-coordiate of the data point.</param>
        /// <param name="y">The y-coordiate of the data point.</param>
        public Point2D(double x, double y) 
            : this()
        {
            X = x;
            Y = y;
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets and sets the x-coordinate of the data point.
        /// </summary>
        public double X { get; set; }

        /// <summary>
        /// Gets and sets the y-coordinate of the data point.
        /// </summary>
        public double Y { get; set; }
        #endregion

        #region Public Methods
        /// <summary>
        /// Overrides System.Object.ToString() and provides a more meaning string.
        /// </summary>
        /// <returns>The string representation of the point.</returns>
        public override string ToString()
        {
            return string.Format("({0}, {1})", X, Y);
        }
        #endregion
    }
}
